import axios from "@/api/request.js";
// get
export const get = (url, params) => {
  return new Promise((resolve, reject) => {
    axios
      .get(url, {params})
      .then((res) => {
        resolve(res.data);
      })
      .catch((error) => {
        reject(error);
      });
  });
};
// post
export const post = (url, params) => {
  return new Promise((resolve, reject) => {
    axios
      .post(url, { ...params })
      .then((res) => {
        resolve(res.data);
      })
      .catch((error) => {
        reject(error);
      });
  });
};
